package org.luxor.commons.core.web.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;

/**
 * Controller基类
 *
 * @author XinmingYan @date 2019/9/16
 */
@ControllerAdvice
public class BaseController {
    protected Logger logger = LoggerFactory.getLogger(getClass());

    protected ResponseEntity getError(Object body, HttpStatus httpStatus) {
        return new ResponseEntity<>(body, httpStatus);
    }

    protected ResponseEntity getSuccess(Object body) {
        return ResponseEntity.ok(body);
    }

}
